<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <title>LCOV - iris.info - randomNumbers/impl/rng.hpp</title>
  <link rel="stylesheet" type="text/css" href="../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LTP GCOV extension - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
        <tr>
          <td class="headerItem" width="20%">Current&nbsp;view:</td>
          <td class="headerValue" width="80%" colspan=4><a href="../../index.html">directory</a> - <a href="index.html">randomNumbers/impl</a> - rng.hpp</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Test:</td>
          <td class="headerValue" width="80%" colspan=4>iris.info</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Date:</td>
          <td class="headerValue" width="20%">2010-05-24</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Instrumented&nbsp;lines:</td>
          <td class="headerValue" width="20%">64</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Code&nbsp;covered:</td>
          <td class="headerValue" width="20%">0.0 %</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Executed&nbsp;lines:</td>
          <td class="headerValue" width="20%">0</td>
        </tr>
        </table>
      </td>
    </tr>
    <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td><pre class="source">
<span class="lineNum">       1 </span>                : // GENERAL PUBLIC LICENSE AGREEMENT
<span class="lineNum">       2 </span>                : // 
<span class="lineNum">       3 </span>                : // PLEASE READ THIS DOCUMENT CAREFULLY BEFORE UTILIZING THE PROGRAM
<span class="lineNum">       4 </span>                : // 
<span class="lineNum">       5 </span>                : // BY UTILIZING THIS PROGRAM, YOU AGREE TO BECOME BOUND BY THE TERMS OF
<span class="lineNum">       6 </span>                : // THIS LICENSE.  IF YOU DO NOT AGREE TO THE TERMS OF THIS LICENSE, DO 
<span class="lineNum">       7 </span>                : // NOT USE THIS PROGRAM OR ANY PORTION THEREOF IN ANY FORM OR MANNER.
<span class="lineNum">       8 </span>                : // 
<span class="lineNum">       9 </span>                : // This Program is licensed, not sold to you by GEORGIA TECH RESEARCH
<span class="lineNum">      10 </span>                : // CORPORATION (&quot;GTRC&quot;), owner of all code and accompanying documentation 
<span class="lineNum">      11 </span>                : // (hereinafter &quot;Program&quot;), for use only under the terms of this License,
<span class="lineNum">      12 </span>                : // and GTRC reserves any rights not expressly granted to you.
<span class="lineNum">      13 </span>                : // 
<span class="lineNum">      14 </span>                : // 1.  This License allows you to:
<span class="lineNum">      15 </span>                : // 
<span class="lineNum">      16 </span>                : // (a) make copies and distribute copies of the Program's source code 
<span class="lineNum">      17 </span>                : // provide that any such copy clearly displays any and all appropriate
<span class="lineNum">      18 </span>                : // copyright notices and disclaimer of warranty as set forth in Article 5
<span class="lineNum">      19 </span>                : // and 6 of this License.  All notices that refer to this License and to 
<span class="lineNum">      20 </span>                : // the absence of any warranty must be kept intact at all times.  A copy
<span class="lineNum">      21 </span>                : // of this License must accompany any and all copies of the Program
<span class="lineNum">      22 </span>                : // distributed to third parties.
<span class="lineNum">      23 </span>                : // 
<span class="lineNum">      24 </span>                : // A fee may be charged to cover the cost associated with the physical 
<span class="lineNum">      25 </span>                : // act of transferring a copy to a third party.  At no time shall the
<span class="lineNum">      26 </span>                : // program be sold for commercial gain either alone or incorporated with
<span class="lineNum">      27 </span>                : // other program(s) without entering into a separate agreement with GTRC. 
<span class="lineNum">      28 </span>                : //  
<span class="lineNum">      29 </span>                : // 
<span class="lineNum">      30 </span>                : // (b) modify the original copy or copies of the Program or any portion
<span class="lineNum">      31 </span>                : // thereof (&quot;Modification(s)&quot;).  Modifications may be copied and
<span class="lineNum">      32 </span>                : // distributed under the terms and conditions as set forth above, 
<span class="lineNum">      33 </span>                : // provided the following conditions are met:
<span class="lineNum">      34 </span>                : // 
<span class="lineNum">      35 </span>                : //     i) any and all modified files must be affixed with prominent
<span class="lineNum">      36 </span>                : // notices that you have changed the files and the date that the changes
<span class="lineNum">      37 </span>                : // occurred.
<span class="lineNum">      38 </span>                : //         
<span class="lineNum">      39 </span>                : //     ii) any work that you distribute, publish, or make available, that
<span class="lineNum">      40 </span>                : // in whole or in part contains portions of the Program or derivative
<span class="lineNum">      41 </span>                : // work thereof, must be licensed at no charge to all third parties under 
<span class="lineNum">      42 </span>                : // the terms of this License.
<span class="lineNum">      43 </span>                : // 
<span class="lineNum">      44 </span>                : //    iii) if the modified program normally reads commands interactively
<span class="lineNum">      45 </span>                : // when run, you must cause it, when started running for such interactive
<span class="lineNum">      46 </span>                : // use in the most ordinary way, to display and/or print an announcement 
<span class="lineNum">      47 </span>                : // with all appropriate copyright notices and disclaimer of warranty as
<span class="lineNum">      48 </span>                : // set forth in Article 5 and 6 of this License to be clearly displayed.
<span class="lineNum">      49 </span>                : // In addition, you must provide reasonable access to this License to the 
<span class="lineNum">      50 </span>                : // user.
<span class="lineNum">      51 </span>                : // 
<span class="lineNum">      52 </span>                : // Any portion of a Modification that can be reasonably considered
<span class="lineNum">      53 </span>                : // independent of the Program and separate work in and of itself is not
<span class="lineNum">      54 </span>                : // subject to the terms and conditions set forth in this License as long 
<span class="lineNum">      55 </span>                : // as it is not distributed with the Program or any portion thereof.
<span class="lineNum">      56 </span>                : // 
<span class="lineNum">      57 </span>                : // 
<span class="lineNum">      58 </span>                : // 2. This License further allows you to copy and distribute the Program
<span class="lineNum">      59 </span>                : //    or a work based on it, as set forth in Article 1 Section b in 
<span class="lineNum">      60 </span>                : //    object code or executable form under the terms of Article 1 above
<span class="lineNum">      61 </span>                : //    provided that you also either:
<span class="lineNum">      62 </span>                : // 
<span class="lineNum">      63 </span>                : //    i) accompany it with complete corresponding machine-readable source
<span class="lineNum">      64 </span>                : // code, which must be distributed under the terms of Article 1, on a 
<span class="lineNum">      65 </span>                : // medium customarily used for software interchange; or,
<span class="lineNum">      66 </span>                : // 
<span class="lineNum">      67 </span>                : //   ii) accompany it with a written offer, valid for no less than three
<span class="lineNum">      68 </span>                : // (3) years from the time of distribution, to give any third party, for
<span class="lineNum">      69 </span>                : // no consideration greater than the cost of physical transfer, a
<span class="lineNum">      70 </span>                : // complete machine-readable copy of the corresponding source code, to be
<span class="lineNum">      71 </span>                : // distributed under the terms of Article 1 on a medium customarily used
<span class="lineNum">      72 </span>                : // for software interchange; or,
<span class="lineNum">      73 </span>                : // 
<span class="lineNum">      74 </span>                : // 
<span class="lineNum">      75 </span>                : // 3.  Export Law Assurance.
<span class="lineNum">      76 </span>                : // 
<span class="lineNum">      77 </span>                : // You agree that the Software will not be shipped, transferred or
<span class="lineNum">      78 </span>                : // exported, directly into any country prohibited by the United States 
<span class="lineNum">      79 </span>                : // Export Administration Act and the regulations thereunder nor will be
<span class="lineNum">      80 </span>                : // used for any purpose prohibited by the Act.
<span class="lineNum">      81 </span>                : //  
<span class="lineNum">      82 </span>                : // 4.  Termination.
<span class="lineNum">      83 </span>                : // 
<span class="lineNum">      84 </span>                : // If at anytime you are unable to comply with any portion of this 
<span class="lineNum">      85 </span>                : // License you must immediately cease use of the Program and all
<span class="lineNum">      86 </span>                : // distribution activities involving the Program or any portion thereof.
<span class="lineNum">      87 </span>                : // 
<span class="lineNum">      88 </span>                : // 
<span class="lineNum">      89 </span>                : // 5.  Disclaimer of Warranties and Limitation on Liability. 
<span class="lineNum">      90 </span>                : // 
<span class="lineNum">      91 </span>                : // YOU ACCEPT THE PROGRAM ON AN &quot;AS IS&quot; BASIS.  GTRC MAKES NO WARRANTY
<span class="lineNum">      92 </span>                : // THAT ALL ERRORS CAN BE OR HAVE BEEN ELIMINATED FROM PROGRAM.  GTRC
<span class="lineNum">      93 </span>                : // SHALL NOT BE RESPONSIBLE FOR LOSSES OF ANY KIND RESULTING FROM THE USE 
<span class="lineNum">      94 </span>                : // OF PROGRAM AND ITS ACCOMPANYING DOCUMENT(S), AND CAN IN NO WAY PROVIDE
<span class="lineNum">      95 </span>                : // COMPENSATION FOR ANY LOSSES SUSTAINED, INCLUDING BUT NOT LIMITED TO
<span class="lineNum">      96 </span>                : // ANY OBLIGATION, LIABILITY, RIGHT, CLAIM OR REMEDY FOR TORT, OR FOR ANY 
<span class="lineNum">      97 </span>                : // ACTUAL OR ALLEGED INFRINGEMENT OF PATENTS, COPYRIGHTS, TRADE SECRETS,
<span class="lineNum">      98 </span>                : // OR SIMILAR RIGHTS OF THIRD PARTIES, NOR ANY BUSINESS EXPENSE, MACHINE
<span class="lineNum">      99 </span>                : // DOWNTIME OR DAMAGES CAUSED TO YOU BY ANY DEFICIENCY, DEFECT OR ERROR 
<span class="lineNum">     100 </span>                : // IN PROGRAM OR MALFUNCTION THEREOF, NOR ANY INCIDENTAL OR CONSEQUENTIAL
<span class="lineNum">     101 </span>                : // DAMAGES, HOWEVER CAUSED.  GTRC DISCLAIMS ALL WARRANTIES, BOTH EXPRESS
<span class="lineNum">     102 </span>                : // AND IMPLIED RESPECTING THE USE AND OPERATION OF PROGRAM AND ITS 
<span class="lineNum">     103 </span>                : // ACCOMPANYING DOCUMENTATION, INCLUDING ALL IMPLIED WARRANTIES OF
<span class="lineNum">     104 </span>                : // MERCHANTABILITY AND FITNESS FOR PARTICULAR PURPOSE AND ANY IMPLIED
<span class="lineNum">     105 </span>                : // WARRANTY ARISING FROM COURSE OF PERFORMANCE, COURSE OF DEALING OR
<span class="lineNum">     106 </span>                : // USAGE OF TRADE.  GTRC MAKES NO WARRANTY THAT PROGRAM IS ADEQUATELY OR 
<span class="lineNum">     107 </span>                : // COMPLETELY DESCRIBED IN, OR BEHAVES IN ACCORDANCE WITH ANY
<span class="lineNum">     108 </span>                : // ACCOMPANYING DOCUMENTATION.  THE USER OF PROGRAM IS EXPECTED TO MAKE
<span class="lineNum">     109 </span>                : // THE FINAL EVALUATION OF PROGRAM'S USEFULNESS IN USER'S OWN
<span class="lineNum">     110 </span>                : // ENVIRONMENT. 
<span class="lineNum">     111 </span>                : // 
<span class="lineNum">     112 </span>                : // GTRC represents that, to the best of its knowledge, the software
<span class="lineNum">     113 </span>                : // furnished hereunder does not infringe any copyright or patent.
<span class="lineNum">     114 </span>                : // 
<span class="lineNum">     115 </span>                : // GTRC shall have no obligation for support or maintenance of Program. 
<span class="lineNum">     116 </span>                : // 
<span class="lineNum">     117 </span>                : // 6.  Copyright Notice.
<span class="lineNum">     118 </span>                : // 
<span class="lineNum">     119 </span>                : // THE SOFTWARE AND ACCOMPANYING DOCUMENTATION ARE COPYRIGHTED WITH ALL
<span class="lineNum">     120 </span>                : // RIGHTS RESERVED BY GTRC.  UNDER UNITED STATES COPYRIGHT LAWS, THE
<span class="lineNum">     121 </span>                : // SOFTWARE AND ITS ACCOMPANYING DOCUMENTATION MAY NOT BE COPIED EXCEPT 
<span class="lineNum">     122 </span>                : // AS GRANTED HEREIN.
<span class="lineNum">     123 </span>                : // 
<span class="lineNum">     124 </span>                : // You acknowledge that GTRC is the sole owner of Program, including all
<span class="lineNum">     125 </span>                : // copyrights subsisting therein.  Any and all copies or partial copies
<span class="lineNum">     126 </span>                : // of Program made by you shall bear the copyright notice set forth below 
<span class="lineNum">     127 </span>                : // and affixed to the original version or such other notice as GTRC shall
<span class="lineNum">     128 </span>                : // designate.  Such notice shall also be affixed to all improvements or
<span class="lineNum">     129 </span>                : // enhancements of Program made by you or portions thereof in such a 
<span class="lineNum">     130 </span>                : // manner and location as to give reasonable notice of GTRC's copyright
<span class="lineNum">     131 </span>                : // as set forth in Article 1.
<span class="lineNum">     132 </span>                : // 
<span class="lineNum">     133 </span>                : // Said copyright notice shall read as follows:
<span class="lineNum">     134 </span>                : // 
<span class="lineNum">     135 </span>                : // Copyright 2004
<span class="lineNum">     136 </span>                : // Dr. George F. Riley 
<span class="lineNum">     137 </span>                : // Georgia Tech Research Corporation
<span class="lineNum">     138 </span>                : // Atlanta, Georgia 30332-0415
<span class="lineNum">     139 </span>                : // All Rights Reserved
<span class="lineNum">     140 </span>                : //
<span class="lineNum">     141 </span>                : // $Id: rng.h,v 1.7 2006/01/31 20:48:39 riley Exp $
<span class="lineNum">     142 </span>                : 
<span class="lineNum">     143 </span>                : 
<span class="lineNum">     144 </span>                : 
<span class="lineNum">     145 </span>                : // Georgia Tech Network Simulator - Random Number class 
<span class="lineNum">     146 </span>                : // George F. Riley.  Georgia Tech, Spring 2002
<span class="lineNum">     147 </span>                : 
<span class="lineNum">     148 </span>                : // Random is base class for all random number generators
<span class="lineNum">     149 </span>                : 
<span class="lineNum">     150 </span>                : #ifndef __random_h__
<span class="lineNum">     151 </span>                : #define __random_h__
<span class="lineNum">     152 </span>                : 
<span class="lineNum">     153 </span>                : #include &lt;vector&gt;
<span class="lineNum">     154 </span>                : #include &lt;algorithm&gt; 
<span class="lineNum">     155 </span>                : 
<span class="lineNum">     156 </span>                : #include &quot;common-defs.hpp&quot;
<span class="lineNum">     157 </span>                : #include &quot;RngStream.hpp&quot;
<span class="lineNum">     158 </span>                : 
<span class="lineNum">     159 </span>                : typedef double        Random_t;  // Real Random Variable
<span class="lineNum">     160 </span>                : typedef unsigned long IRandom_t; // Integer Random Variable
<span class="lineNum">     161 </span>                : typedef double        CDF_t;     // Cumulative distribution Function value 
<span class="lineNum">     162 </span>                : typedef unsigned long Seed_t;
<span class="lineNum">     163 </span>                : 
<span class="lineNum">     164 </span>                : class Uniform;
<span class="lineNum">     165 </span>                : 
<span class="lineNum">     166 </span><span class="lineNoCov">              0 : class Seed {</span>
<span class="lineNum">     167 </span>                :   // Seed is used to seed the random number generator(s)
<span class="lineNum">     168 </span>                :   // This is a base class for RandomSeed and ConstantSeed
<span class="lineNum">     169 </span>                :   // No constructors supplied, since we can't create any of these 
<span class="lineNum">     170 </span>                : public:
<span class="lineNum">     171 </span><span class="lineNoCov">              0 :   virtual ~Seed() {}</span>
<span class="lineNum">     172 </span>                :   virtual bool IsRandom() const = 0;
<span class="lineNum">     173 </span>                : };
<span class="lineNum">     174 </span>                : 
<span class="lineNum">     175 </span>                : class RandomSeed : public Seed {
<span class="lineNum">     176 </span>                : public:
<span class="lineNum">     177 </span><span class="lineNoCov">              0 :   RandomSeed() {};</span>
<span class="lineNum">     178 </span><span class="lineNoCov">              0 :   ~RandomSeed() {};</span>
<span class="lineNum">     179 </span><span class="lineNoCov">              0 :   bool IsRandom() const { return true; } </span>
<span class="lineNum">     180 </span>                : };
<span class="lineNum">     181 </span>                : 
<span class="lineNum">     182 </span>                : class ConstantSeed : public Seed 
<span class="lineNum">     183 </span>                : {
<span class="lineNum">     184 </span>                : public:
<span class="lineNum">     185 </span>                :   ConstantSeed(Seed_t); // Use six copies of the specified value
<span class="lineNum">     186 </span>                :   ConstantSeed(Seed_t,Seed_t,Seed_t,Seed_t,Seed_t,Seed_t);  // Six seeds
<span class="lineNum">     187 </span><span class="lineNoCov">              0 :   bool IsRandom() const { return false; } </span>
<span class="lineNum">     188 </span><span class="lineNoCov">              0 :   ~ConstantSeed() {};</span>
<span class="lineNum">     189 </span>                : public:
<span class="lineNum">     190 </span>                :   Seed_t seeds[6];
<span class="lineNum">     191 </span>                : };
<span class="lineNum">     192 </span>                :   
<span class="lineNum">     193 </span>                :   
<span class="lineNum">     194 </span>                : //Doc:ClassXRef
<span class="lineNum">     195 </span><span class="lineNoCov">              0 : class Random { </span>
<span class="lineNum">     196 </span>                :   //Doc:Class \GTNS\ has a rich set of  random number generators.
<span class="lineNum">     197 </span>                :   //Doc:Class Class {\tt Random} defines the base class functionalty 
<span class="lineNum">     198 </span>                :   //Doc:Class required for all random number generators.
<span class="lineNum">     199 </span>                :   //Doc:Class Note: The underlying random number generation method used
<span class="lineNum">     200 </span>                :   //Doc:Class by \GTNS\ is the {\tt RngStream} code by Pierre L'Ecuyer at
<span class="lineNum">     201 </span>                :   //Doc:Class the University of Montreal. 
<span class="lineNum">     202 </span>                : public:
<span class="lineNum">     203 </span>                :   //Doc:Method
<span class="lineNum">     204 </span>                :   Random();
<span class="lineNum">     205 </span>                :     //Doc:Desc Constructor for a random number generator with a random seed.
<span class="lineNum">     206 </span>                : 
<span class="lineNum">     207 </span><span class="lineNoCov">              0 :   virtual ~Random() { }</span>
<span class="lineNum">     208 </span>                :   //Doc:Method
<span class="lineNum">     209 </span>                :   virtual Random_t  Value();     // Returns a value [ 0.0 .. 1.0)
<span class="lineNum">     210 </span>                :     //Doc:Desc Return a floating point random value
<span class="lineNum">     211 </span>                :     //Doc:Return Floating point random value.
<span class="lineNum">     212 </span>                : 
<span class="lineNum">     213 </span>                :   // Returns integer value
<span class="lineNum">     214 </span>                :   //Doc:Method
<span class="lineNum">     215 </span><span class="lineNoCov">              0 :   virtual IRandom_t IntValue() { return (IRandom_t)Value();} </span>
<span class="lineNum">     216 </span>                :     //Doc:Desc Return an integer random value.
<span class="lineNum">     217 </span>                :     //Doc:Return Integer random value.
<span class="lineNum">     218 </span>                : 
<span class="lineNum">     219 </span>                :   virtual Random*   Copy() const;
<span class="lineNum">     220 </span>                : 
<span class="lineNum">     221 </span>                :   // Static methods
<span class="lineNum">     222 </span>                : 
<span class="lineNum">     223 </span>                :   //Doc:Method
<span class="lineNum">     224 </span>                :   bool SetSeed(const Seed&amp;);
<span class="lineNum">     225 </span>                :     //Doc:Desc Use a private seed and private stream for this generator.
<span class="lineNum">     226 </span>                :     //Doc:Arg1 Seed to use.  Can either be a RandomSeed or ConstantSeed.
<span class="lineNum">     227 </span>                :     //Doc:Return True if valid seed.
<span class="lineNum">     228 </span>                : 
<span class="lineNum">     229 </span>                : 
<span class="lineNum">     230 </span>                :   //Doc:Method
<span class="lineNum">     231 </span><span class="lineNoCov">              0 :   static  void UseDevRandom(bool udr = true) { useDevRandom = udr;} </span>
<span class="lineNum">     232 </span>                :     //Doc:Desc Specify whether the linux device {\tt /dev/random} is to
<span class="lineNum">     233 </span>                :     //Doc:Desc be used for a random seed.
<span class="lineNum">     234 </span>                :     //Doc:Arg1 True if {\tt /dev/random} desired.
<span class="lineNum">     235 </span>                : 
<span class="lineNum">     236 </span>                :   // Use the global seed to force precisely reproducible results. 
<span class="lineNum">     237 </span>                :   //Doc:Method
<span class="lineNum">     238 </span>                :   static bool GlobalSeed(Seed_t,Seed_t,Seed_t,Seed_t,Seed_t,Seed_t) ;
<span class="lineNum">     239 </span>                :     //Doc:Desc It is often desirable to create a simulation that uses random
<span class="lineNum">     240 </span>                :     //Doc:Desc numbers, while at the same time is completely reproducible. 
<span class="lineNum">     241 </span>                :     //Doc:Desc Specifying this set of six random seeds initializes the
<span class="lineNum">     242 </span>                :     //Doc:Desc random number generator with the specified seed.
<span class="lineNum">     243 </span>                :     //Doc:Desc This leads to precisely reproducible results.
<span class="lineNum">     244 </span>                :     //Doc:Desc Note. This constructor is deprecated.  New code should use 
<span class="lineNum">     245 </span>                :     //Doc:Desc the GlobalSeed call with a Seed class argument (below).
<span class="lineNum">     246 </span>                :     //Doc:Arg1 Seed to use (32 bit unsigned)
<span class="lineNum">     247 </span>                :     //Doc:Arg2 Seed to use (32 bit unsigned)
<span class="lineNum">     248 </span>                :     //Doc:Arg3 Seed to use (32 bit unsigned)
<span class="lineNum">     249 </span>                :     //Doc:Arg4 Seed to use (32 bit unsigned)
<span class="lineNum">     250 </span>                :     //Doc:Arg5 Seed to use (32 bit unsigned)
<span class="lineNum">     251 </span>                :     //Doc:Arg6 Seed to use (32 bit unsigned)
<span class="lineNum">     252 </span>                :     //Doc:Return True if seed is valid.
<span class="lineNum">     253 </span>                : 
<span class="lineNum">     254 </span>                :   //Doc:Method
<span class="lineNum">     255 </span>                :   static bool GlobalSeed(const Seed&amp;); 
<span class="lineNum">     256 </span>                :     //Doc:Desc It is often desirable to create a simulation that uses random
<span class="lineNum">     257 </span>                :     //Doc:Desc numbers, while at the same time is completely reproducible.
<span class="lineNum">     258 </span>                :     //Doc:Desc Specifying this set of six random seeds initializes the 
<span class="lineNum">     259 </span>                :     //Doc:Desc random number generator with the specified seed.
<span class="lineNum">     260 </span>                :     //Doc:Desc This leads to precisely reproducible results.
<span class="lineNum">     261 </span>                :     //Doc:Arg1 Seed to use.  Can either be a RandomSeed or ConstantSeed.
<span class="lineNum">     262 </span>                :     //Doc:Return True if seed is valid. 
<span class="lineNum">     263 </span>                : 
<span class="lineNum">     264 </span>                : private:
<span class="lineNum">     265 </span>                :   RngStream* privateStream;    // Private stream for generator (if specified)
<span class="lineNum">     266 </span>                :   static void Initialize();    // Initialize  the RNG system
<span class="lineNum">     267 </span>                :   static void GetRandomSeeds(Seed_t seeds[6]);
<span class="lineNum">     268 </span>                : private: 
<span class="lineNum">     269 </span>                :   static bool useDevRandom;    // True if using /dev/random desired
<span class="lineNum">     270 </span>                :   static bool globalSeedSet;   // True if global seed has been specified
<span class="lineNum">     271 </span>                :   static int  devRandom;       // File handle for /dev/random
<span class="lineNum">     272 </span>                :   static Seed_t globalSeed[6]; // The global seed to use 
<span class="lineNum">     273 </span>                : protected:
<span class="lineNum">     274 </span>                :   static unsigned long heuristic_sequence;
<span class="lineNum">     275 </span>                :   static RngStream* globalRNG;
<span class="lineNum">     276 </span>                : public:
<span class="lineNum">     277 </span>                : };
<span class="lineNum">     278 </span>                : 
<span class="lineNum">     279 </span>                : 
<span class="lineNum">     280 </span>                : //Doc:ClassXRef
<span class="lineNum">     281 </span><span class="lineNoCov">              0 : class Uniform : public Random { // Uniformly distributed random variable</span>
<span class="lineNum">     282 </span>                :   //Doc:Class Creates a uniformly distributed random number generator. 
<span class="lineNum">     283 </span>                : public:
<span class="lineNum">     284 </span>                :   //Doc:Method
<span class="lineNum">     285 </span><span class="lineNoCov">              0 :   Uniform() : m_min(0), m_max(1.0) { }</span>
<span class="lineNum">     286 </span>                :     //Doc:Desc Creates a uniform random number generator in the
<span class="lineNum">     287 </span>                :     //Doc:Desc range [0.0 .. 1.0)
<span class="lineNum">     288 </span>                : 
<span class="lineNum">     289 </span>                :   //Doc:Method
<span class="lineNum">     290 </span><span class="lineNoCov">              0 :   Uniform(Random_t s, Random_t l) : m_min(s), m_max(l) { }; </span>
<span class="lineNum">     291 </span>                :     //Doc:Desc Creates a uniform random number generator with the specified
<span class="lineNum">     292 </span>                :     //Doc:Desc range.
<span class="lineNum">     293 </span>                : 
<span class="lineNum">     294 </span><span class="lineNoCov">              0 :   Uniform(const Uniform&amp; c) : m_min(c.m_min), m_max(c.m_max) { }</span>
<span class="lineNum">     295 </span>                :   virtual Random_t Value();
<span class="lineNum">     296 </span>                :   virtual Random*  Copy() const; 
<span class="lineNum">     297 </span>                : private:
<span class="lineNum">     298 </span>                :   Random_t m_min;
<span class="lineNum">     299 </span>                :   Random_t m_max;
<span class="lineNum">     300 </span>                : };
<span class="lineNum">     301 </span>                : 
<span class="lineNum">     302 </span>                : //Doc:ClassXRef
<span class="lineNum">     303 </span><span class="lineNoCov">              0 : class Constant : public Random { // A random variable that returns a constant</span>
<span class="lineNum">     304 </span>                :   //Doc:Class Class {\tt Constant} defines a random number generator that 
<span class="lineNum">     305 </span>                :   //Doc:Class returns the same value every sample.  It's not immediately
<span class="lineNum">     306 </span>                :   //Doc:Class obvious
<span class="lineNum">     307 </span>                :   //Doc:Class why such a generator is useful, but it is.  A number of other
<span class="lineNum">     308 </span>                :   //Doc:Class \GTNS\ objects require a random number generator as parameters 
<span class="lineNum">     309 </span>                :   //Doc:Class to describe the behavior.  For example, application {\tt TCPSend}
<span class="lineNum">     310 </span>                :   //Doc:Class uses a random number generator to determine how much data
<span class="lineNum">     311 </span>                :   //Doc:Class to send.  By passing a {\tt Constant} RNG to the {\tt TCPSend} 
<span class="lineNum">     312 </span>                :   //Doc:Class application, it will send a known constant amount.
<span class="lineNum">     313 </span>                : 
<span class="lineNum">     314 </span>                : public:
<span class="lineNum">     315 </span>                :   //Doc:Method
<span class="lineNum">     316 </span><span class="lineNoCov">              0 :   Constant() : m_const(0) { }</span>
<span class="lineNum">     317 </span>                :     //Doc:Desc Construct a {\tt Constant} RNG that return zero every sample.
<span class="lineNum">     318 </span>                : 
<span class="lineNum">     319 </span>                :   //Doc:Method
<span class="lineNum">     320 </span><span class="lineNoCov">              0 :   Constant(Random_t c) : m_const(c) { };</span>
<span class="lineNum">     321 </span>                :     //Doc:Desc Construct a {\tt Constant} RNG that returns the specified value
<span class="lineNum">     322 </span>                :     //Doc:Desc every sample.
<span class="lineNum">     323 </span>                :     //Doc:Arg1 Constant value for this RNG.
<span class="lineNum">     324 </span>                : 
<span class="lineNum">     325 </span><span class="lineNoCov">              0 :   Constant(const Constant&amp; c) : m_const(c.m_const) { }</span>
<span class="lineNum">     326 </span>                :   //Doc:Method
<span class="lineNum">     327 </span><span class="lineNoCov">              0 :   void    NewConstant(Random_t c) { m_const = c;}</span>
<span class="lineNum">     328 </span>                :     //Doc:Desc Specify a new constant RNG for this generator.
<span class="lineNum">     329 </span>                :     //Doc:Arg1 Constant value for this RNG. 
<span class="lineNum">     330 </span>                : 
<span class="lineNum">     331 </span>                :   virtual Random_t  Value();
<span class="lineNum">     332 </span>                :   virtual IRandom_t IntValue();
<span class="lineNum">     333 </span>                :   virtual Random*   Copy() const;
<span class="lineNum">     334 </span>                : private:
<span class="lineNum">     335 </span>                :   Random_t m_const;
<span class="lineNum">     336 </span>                : };
<span class="lineNum">     337 </span>                : 
<span class="lineNum">     338 </span>                : //Doc:ClassXRef
<span class="lineNum">     339 </span><span class="lineNoCov">              0 : class Sequential : public Random { // Return a sequential list of values </span>
<span class="lineNum">     340 </span>                :   //Doc:Class Class {\tt Sequential} defines a random number generator that
<span class="lineNum">     341 </span>                :   //Doc:Class returns a sequential sequence.
<span class="lineNum">     342 </span>                : public:
<span class="lineNum">     343 </span>                :   // first, last, increment, consecutive
<span class="lineNum">     344 </span>                :   //Doc:Method
<span class="lineNum">     345 </span>                :   Sequential(Random_t f, Random_t l, Random_t i = 1, Count_t c = 1); 
<span class="lineNum">     346 </span>                :     //Doc:Desc Constructor for the {\tt Sequential} RNG.  The four parameters
<span class="lineNum">     347 </span>                :     //Doc:Desc define the sequence.  For example {\tt Sequential(0, 5, 1, 2)}
<span class="lineNum">     348 </span>                :     //Doc:Desc returns the sequence 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 0, 0 \ldots 
<span class="lineNum">     349 </span>                :     //Doc:Arg1 First value returned.
<span class="lineNum">     350 </span>                :     //Doc:Arg2 Last + 1 value returned.
<span class="lineNum">     351 </span>                :     //Doc:Arg3 Increment.
<span class="lineNum">     352 </span>                :     //Doc:Arg4 Repeat count for  each  value.
<span class="lineNum">     353 </span>                : 
<span class="lineNum">     354 </span>                :   //Doc:Method
<span class="lineNum">     355 </span>                :   Sequential(Random_t f, Random_t l, const Random&amp; i, Count_t c = 1); 
<span class="lineNum">     356 </span>                :     //Doc:Desc Constructor for the {\tt Sequential} RNG.
<span class="lineNum">     357 </span>                :     //Doc:Desc Differs from the first constructor only in the fact that the
<span class="lineNum">     358 </span>                :     //Doc:Desc increment paramenter is a random variable.
<span class="lineNum">     359 </span>                :     //Doc:Arg1 First value returned. 
<span class="lineNum">     360 </span>                :     //Doc:Arg2 Last + 1 value returned.
<span class="lineNum">     361 </span>                :     //Doc:Arg3 Reference to a random variable for the sequence increment.
<span class="lineNum">     362 </span>                :     //Doc:Arg4 Repeat count for  each  value.
<span class="lineNum">     363 </span>                : 
<span class="lineNum">     364 </span>                :   Sequential(const Sequential&amp; c);
<span class="lineNum">     365 </span>                :   virtual Random_t Value(); 
<span class="lineNum">     366 </span>                :   virtual Random*  Copy() const;
<span class="lineNum">     367 </span>                : private:
<span class="lineNum">     368 </span>                :   Random_t m_min;
<span class="lineNum">     369 </span>                :   Random_t m_max;
<span class="lineNum">     370 </span>                :   Random*  m_increment;
<span class="lineNum">     371 </span>                :   Count_t  m_consecutive;
<span class="lineNum">     372 </span>                :   Random_t m_current;
<span class="lineNum">     373 </span>                :   Count_t  m_currentConsecutive;
<span class="lineNum">     374 </span>                : };
<span class="lineNum">     375 </span>                : 
<span class="lineNum">     376 </span>                : //Doc:ClassXRef
<span class="lineNum">     377 </span><span class="lineNoCov">              0 : class Exponential : public Random { // Exponentially Distributed random var</span>
<span class="lineNum">     378 </span>                :   //Doc:Class Class {\tt Exponential} defines a random variable with an
<span class="lineNum">     379 </span>                :   //Doc:Class  exponential distribution.
<span class="lineNum">     380 </span>                : public: 
<span class="lineNum">     381 </span>                :   //Doc:Method
<span class="lineNum">     382 </span><span class="lineNoCov">              0 :   Exponential() : m_mean(1.0), m_bound(0) { }</span>
<span class="lineNum">     383 </span>                :     //Doc:Desc Constructs an exponential random variable  with a mean
<span class="lineNum">     384 </span>                :     //Doc:Desc value of 1.0.
<span class="lineNum">     385 </span>                : 
<span class="lineNum">     386 </span>                :   //Doc:Method
<span class="lineNum">     387 </span><span class="lineNoCov">              0 :   explicit Exponential(Random_t m) : m_mean(m), m_bound(0) { }; </span>
<span class="lineNum">     388 </span>                :     //Doc:Desc Constructs an exponential  random variable with the specified
<span class="lineNum">     389 </span>                :     //Doc:Desc mean value.
<span class="lineNum">     390 </span>                :     //Doc:Arg1 Mean value for the random variable.
<span class="lineNum">     391 </span>                : 
<span class="lineNum">     392 </span>                :   //Doc:Method
<span class="lineNum">     393 </span><span class="lineNoCov">              0 :   Exponential(Random_t m, Random_t b) : m_mean(m), m_bound(b) { }; </span>
<span class="lineNum">     394 </span>                :     //Doc:Desc Constructs an exponential randome variable  with the specified
<span class="lineNum">     395 </span>                :     //Doc:Desc mean value and specified upper limit.  Since exponential
<span class="lineNum">     396 </span>                :     //Doc:Desc distributions can theoretically return unbounded values, 
<span class="lineNum">     397 </span>                :     //Doc:Desc it is sometimes useful to specify  a fixed upper limit.
<span class="lineNum">     398 </span>                :     //Doc:Desc Note however that when the upper limit is specified, the
<span class="lineNum">     399 </span>                :     //Doc:Desc true mean of the distribution is slightly smaller than 
<span class="lineNum">     400 </span>                :     //Doc:Desc the mean value specified.
<span class="lineNum">     401 </span>                :     //Doc:Arg1 Mean value for the random variable.
<span class="lineNum">     402 </span>                :     //Doc:Arg2 Upper limit on returned values.
<span class="lineNum">     403 </span>                : 
<span class="lineNum">     404 </span><span class="lineNoCov">              0 :   Exponential(const Exponential&amp; c) : m_mean(c.m_mean), m_bound( c.m_bound) { }</span>
<span class="lineNum">     405 </span>                :   virtual Random_t Value();
<span class="lineNum">     406 </span>                :   virtual Random* Copy() const;
<span class="lineNum">     407 </span>                : private:
<span class="lineNum">     408 </span>                :   Random_t m_mean;  // Mean value of RV
<span class="lineNum">     409 </span>                :   Random_t m_bound; // Upper bound on value (if non-zero)
<span class="lineNum">     410 </span>                : };
<span class="lineNum">     411 </span>                : 
<span class="lineNum">     412 </span>                : //Doc:ClassXRef 
<span class="lineNum">     413 </span><span class="lineNoCov">              0 : class Pareto : public Random { // Pareto distributed random var</span>
<span class="lineNum">     414 </span>                :   //Doc:Class Class {\tt Pareto} defines a random variable with a
<span class="lineNum">     415 </span>                :   //Doc:Class pareto distribution.
<span class="lineNum">     416 </span>                : public:
<span class="lineNum">     417 </span>                :   //Doc:Method
<span class="lineNum">     418 </span><span class="lineNoCov">              0 :   Pareto() : m_mean( 1.0), m_shape(1.5), m_bound(0) { }</span>
<span class="lineNum">     419 </span>                :     //Doc:Desc Constructs a pareto random variable  with a mean
<span class="lineNum">     420 </span>                :     //Doc:Desc value of 1.0 and a shape (alpha) parameter of 1.5.
<span class="lineNum">     421 </span>                : 
<span class="lineNum">     422 </span>                :   //Doc:Method
<span class="lineNum">     423 </span><span class="lineNoCov">              0 :   explicit Pareto(Random_t m) </span>
<span class="lineNum">     424 </span><span class="lineNoCov">              0 :     : m_mean(m), m_shape(1.5), m_bound(0) { };</span>
<span class="lineNum">     425 </span>                :     //Doc:Desc Constructs a pareto random variable with the specified mean
<span class="lineNum">     426 </span>                :     //Doc:Desc value and a shape (alpha) parameter of 1.5.
<span class="lineNum">     427 </span>                :     //Doc:Arg1 Mean value for the distribution. 
<span class="lineNum">     428 </span>                : 
<span class="lineNum">     429 </span>                :   //Doc:Method
<span class="lineNum">     430 </span><span class="lineNoCov">              0 :   Pareto(Random_t m, Random_t s) </span>
<span class="lineNum">     431 </span><span class="lineNoCov">              0 :     : m_mean(m), m_shape(s), m_bound(0) { };</span>
<span class="lineNum">     432 </span>                :     //Doc:Desc Constructs a pareto random variable with the specified mean
<span class="lineNum">     433 </span>                :     //Doc:Desc value and shape (alpha). 
<span class="lineNum">     434 </span>                :     //Doc:Arg1 Mean value for the distribution.
<span class="lineNum">     435 </span>                :     //Doc:Arg2 Shape (alpha) parameter for the distribution.
<span class="lineNum">     436 </span>                : 
<span class="lineNum">     437 </span>                :   //Doc:Method
<span class="lineNum">     438 </span><span class="lineNoCov">              0 :   Pareto(Random_t m, Random_t s, Random_t b) </span>
<span class="lineNum">     439 </span><span class="lineNoCov">              0 :     : m_mean(m), m_shape(s), m_bound(b) { }; </span>
<span class="lineNum">     440 </span>                :     //Doc:Desc Constructs a pareto random variable with the specified mean
<span class="lineNum">     441 </span>                :     //Doc:Desc value, shape (alpha), and upper bound.
<span class="lineNum">     442 </span>                :     //Doc:Desc Since pareto 
<span class="lineNum">     443 </span>                :     //Doc:Desc distributions can theoretically return unbounded values, 
<span class="lineNum">     444 </span>                :     //Doc:Desc it is sometimes useful to specify  a fixed upper limit.
<span class="lineNum">     445 </span>                :     //Doc:Desc Note however that when the upper limit is specified, the
<span class="lineNum">     446 </span>                :     //Doc:Desc true mean of the distribution is slightly smaller than 
<span class="lineNum">     447 </span>                :     //Doc:Desc the mean value specified.
<span class="lineNum">     448 </span>                :     //Doc:Arg1 Mean value for the random variable.
<span class="lineNum">     449 </span>                :     //Doc:Arg2 Shape (alpha) parameter for the distribution.
<span class="lineNum">     450 </span>                :     //Doc:Arg3 Upper limit on returned values.
<span class="lineNum">     451 </span>                : 
<span class="lineNum">     452 </span><span class="lineNoCov">              0 :   Pareto(const Pareto&amp; c) </span>
<span class="lineNum">     453 </span><span class="lineNoCov">              0 :     : m_mean(c.m_mean), m_shape(c.m_shape), m_bound(c.m_bound) { }</span>
<span class="lineNum">     454 </span>                :   virtual Random_t Value();
<span class="lineNum">     455 </span>                :   virtual Random* Copy() const;
<span class="lineNum">     456 </span>                : private:
<span class="lineNum">     457 </span>                :   Random_t m_mean;  // Mean value of RV
<span class="lineNum">     458 </span>                :   Random_t m_shape; // Shape parameter 
<span class="lineNum">     459 </span>                :   Random_t m_bound; // Upper bound on value (if non-zero)
<span class="lineNum">     460 </span>                : };
<span class="lineNum">     461 </span>                : 
<span class="lineNum">     462 </span>                : //Doc:ClassXRef
<span class="lineNum">     463 </span><span class="lineNoCov">              0 : class Weibull : public Random { // Weibull distributed random var</span>
<span class="lineNum">     464 </span>                :   //Doc:Class Class {\tt Weibull} defines a random variable with a 
<span class="lineNum">     465 </span>                :   //Doc:Class weibull distribution.
<span class="lineNum">     466 </span>                : public:
<span class="lineNum">     467 </span>                :   //Doc:Method
<span class="lineNum">     468 </span><span class="lineNoCov">              0 :   Weibull() : m_mean(1.0), m_alpha(1), m_bound(0) { }</span>
<span class="lineNum">     469 </span>                :     //Doc:Desc Constructs a weibull random variable  with a mean
<span class="lineNum">     470 </span>                :     //Doc:Desc value of 1.0 and a shape (alpha) parameter of 1
<span class="lineNum">     471 </span>                : 
<span class="lineNum">     472 </span>                :   //Doc:Method
<span class="lineNum">     473 </span><span class="lineNoCov">              0 :   explicit Weibull(Random_t m) </span>
<span class="lineNum">     474 </span><span class="lineNoCov">              0 :     : m_mean(m), m_alpha(1), m_bound(0) { };</span>
<span class="lineNum">     475 </span>                :     //Doc:Desc Constructs a weibull random variable with the specified mean 
<span class="lineNum">     476 </span>                :     //Doc:Desc value and a shape (alpha) parameter of 1.5.
<span class="lineNum">     477 </span>                :     //Doc:Arg1 Mean value for the distribution.
<span class="lineNum">     478 </span>                : 
<span class="lineNum">     479 </span>                :   //Doc:Method
<span class="lineNum">     480 </span><span class="lineNoCov">              0 :   Weibull(Random_t m, Random_t s) </span>
<span class="lineNum">     481 </span><span class="lineNoCov">              0 :     : m_mean(m), m_alpha(s), m_bound(0) { }; </span>
<span class="lineNum">     482 </span>                :     //Doc:Desc Constructs a weibull random variable with the specified mean
<span class="lineNum">     483 </span>                :     //Doc:Desc value and a shape (alpha).
<span class="lineNum">     484 </span>                :     //Doc:Arg1 Mean value for the distribution.
<span class="lineNum">     485 </span>                :     //Doc:Arg2 Shape (alpha) parameter for the distribution. 
<span class="lineNum">     486 </span>                : 
<span class="lineNum">     487 </span>                :   //Doc:Method
<span class="lineNum">     488 </span><span class="lineNoCov">              0 :   Weibull(Random_t m, Random_t s, Random_t b) </span>
<span class="lineNum">     489 </span><span class="lineNoCov">              0 :     : m_mean(m), m_alpha(s), m_bound(b) { };</span>
<span class="lineNum">     490 </span>                :     //Doc:Desc Constructs a weibull random variable with the specified mean
<span class="lineNum">     491 </span>                :     //Doc:Desc value, alpha, and upper bound. 
<span class="lineNum">     492 </span>                :     //Doc:Desc Since weibull 
<span class="lineNum">     493 </span>                :     //Doc:Desc distributions can theoretically return unbounded values,
<span class="lineNum">     494 </span>                :     //Doc:Desc it is sometimes useful to specify  a fixed upper limit.
<span class="lineNum">     495 </span>                :     //Doc:Desc Note however that when the upper limit is specified, the 
<span class="lineNum">     496 </span>                :     //Doc:Desc true mean of the distribution is slightly smaller than
<span class="lineNum">     497 </span>                :     //Doc:Desc the mean value specified.
<span class="lineNum">     498 </span>                :     //Doc:Arg1 Mean value for the random variable.
<span class="lineNum">     499 </span>                :     //Doc:Arg2 Shape (alpha) parameter for the distribution. 
<span class="lineNum">     500 </span>                :     //Doc:Arg3 Upper limit on returned values.
<span class="lineNum">     501 </span>                : 
<span class="lineNum">     502 </span><span class="lineNoCov">              0 :   Weibull(const Weibull&amp; c) </span>
<span class="lineNum">     503 </span><span class="lineNoCov">              0 :     : m_mean(c.m_mean), m_alpha(c.m_alpha), m_bound(c.m_bound) { }</span>
<span class="lineNum">     504 </span>                :   virtual Random_t Value();
<span class="lineNum">     505 </span>                :   virtual Random* Copy() const; 
<span class="lineNum">     506 </span>                : private:
<span class="lineNum">     507 </span>                :   Random_t m_mean;  // Mean value of RV
<span class="lineNum">     508 </span>                :   Random_t m_alpha; // Shape parameter
<span class="lineNum">     509 </span>                :   Random_t m_bound; // Upper bound on value (if non-zero)
<span class="lineNum">     510 </span>                : };
<span class="lineNum">     511 </span>                : 
<span class="lineNum">     512 </span>                : //Doc:ClassXRef
<span class="lineNum">     513 </span><span class="lineNoCov">              0 : class Normal : public Random { // Normally Distributed random var </span>
<span class="lineNum">     514 </span>                :   //Doc:Class Class {\tt Normal} defines a random variable with an
<span class="lineNum">     515 </span>                :   //Doc:Class  exponential distribution.
<span class="lineNum">     516 </span>                : public:
<span class="lineNum">     517 </span>                :   //Doc:Method
<span class="lineNum">     518 </span><span class="lineNoCov">              0 :   Normal() : m_mean(0.0), m_variance(1.0), m_bound(INFINITE_VALUE),</span>
<span class="lineNum">     519 </span><span class="lineNoCov">              0 :                      m_nextValid(false) { } </span>
<span class="lineNum">     520 </span>                :     //Doc:Desc Constructs an normal random variable  with a mean
<span class="lineNum">     521 </span>                :     //Doc:Desc value of 0 and variance of 1.
<span class="lineNum">     522 </span>                : 
<span class="lineNum">     523 </span>                :   //Doc:Method
<span class="lineNum">     524 </span><span class="lineNoCov">              0 :   Normal(Random_t m, Random_t v, Random_t b = INFINITE_VALUE)</span>
<span class="lineNum">     525 </span><span class="lineNoCov">              0 :       : m_mean(m), m_variance(v), m_bound(b), m_nextValid(false) { }; </span>
<span class="lineNum">     526 </span>                :     //Doc:Desc Constructs an normal random variable with the specified
<span class="lineNum">     527 </span>                :     //Doc:Desc mean and variance values.
<span class="lineNum">     528 </span>                :     //Doc:Arg1 Mean value for the random variable.
<span class="lineNum">     529 </span>                :     //Doc:Arg2 Variance for the random variable. 
<span class="lineNum">     530 </span>                :     //Doc:Arg1 Bound value for the random variable.  The bound is
<span class="lineNum">     531 </span>                :     //Doc:Arg1 positive.  The Normal is bounded within +- bound.
<span class="lineNum">     532 </span>                : 
<span class="lineNum">     533 </span><span class="lineNoCov">              0 :   Normal(const Normal&amp; c)</span>
<span class="lineNum">     534 </span><span class="lineNoCov">              0 :       : m_mean(c.m_mean), m_variance(c.m_variance ), m_bound(c.m_bound) { }</span>
<span class="lineNum">     535 </span>                :   virtual Random_t Value();
<span class="lineNum">     536 </span>                :   virtual Random* Copy() const;
<span class="lineNum">     537 </span>                : private:
<span class="lineNum">     538 </span>                :   Random_t m_mean;      // Mean value of RV
<span class="lineNum">     539 </span>                :   Random_t m_variance;  // Mean value of RV
<span class="lineNum">     540 </span>                :   Random_t m_bound;     // Bound on value (absolute value) 
<span class="lineNum">     541 </span>                :   bool     m_nextValid; // True if next valid
<span class="lineNum">     542 </span>                :   Random_t m_next;      // The algorithm produces two values at a time
<span class="lineNum">     543 </span>                : };
<span class="lineNum">     544 </span>                : 
<span class="lineNum">     545 </span>                : // Value/CDF pair class for Emiprical Distributions
<span class="lineNum">     546 </span>                : //Doc:ClassXRef
<span class="lineNum">     547 </span><span class="lineNoCov">              0 : class ValueCDF { </span>
<span class="lineNum">     548 </span>                : public:
<span class="lineNum">     549 </span><span class="lineNoCov">              0 :   ValueCDF() : value(0.0), cdf(0.0){ }</span>
<span class="lineNum">     550 </span><span class="lineNoCov">              0 :   ValueCDF(Random_t v, CDF_t c) : value(v), cdf(c) { }</span>
<span class="lineNum">     551 </span><span class="lineNoCov">              0 :   ValueCDF(const ValueCDF&amp; c) : value(c.value), cdf(c.cdf) { }</span>
<span class="lineNum">     552 </span>                :   Random_t value;
<span class="lineNum">     553 </span>                :   CDF_t    cdf; 
<span class="lineNum">     554 </span>                : };
<span class="lineNum">     555 </span>                : 
<span class="lineNum">     556 </span>                : typedef std::vector&lt;ValueCDF&gt; ValueCDFVec_t;
<span class="lineNum">     557 </span>                : 
<span class="lineNum">     558 </span>                : //Doc:ClassXRef
<span class="lineNum">     559 </span>                : class Empirical : public Random { // Empirical distribution random var
<span class="lineNum">     560 </span>                :   //Doc:Class Defines a random variable  that has a specified, empirical 
<span class="lineNum">     561 </span>                :   //Doc:Class distribution.  The distribution is specified by a
<span class="lineNum">     562 </span>                :   //Doc:Class series of calls the the {\tt CDF} member function, specifying a
<span class="lineNum">     563 </span>                :   //Doc:Class value and the probability that the function value is less than 
<span class="lineNum">     564 </span>                :   //Doc:Class the specified value.  When values are requested,
<span class="lineNum">     565 </span>                :   //Doc:Class a uniform random variable is used to select a probabililty,
<span class="lineNum">     566 </span>                :   //Doc:Class and the return value is interpreted linerarly between the
<span class="lineNum">     567 </span>                :   //Doc:Class two appropriate points in the CDF.
<span class="lineNum">     568 </span>                : public:
<span class="lineNum">     569 </span>                :   //Doc:Method
<span class="lineNum">     570 </span><span class="lineNoCov">              0 :   explicit Empirical() : validated(false) { }</span>
<span class="lineNum">     571 </span>                :     //Doc:Desc Constructor for the {\tt Empirical} random variables.
<span class="lineNum">     572 </span>                : 
<span class="lineNum">     573 </span><span class="lineNoCov">              0 :   virtual ~Empirical() { } </span>
<span class="lineNum">     574 </span><span class="lineNoCov">              0 :   Empirical(const Empirical&amp; c) : validated(c.validated), emp(c.emp) { }</span>
<span class="lineNum">     575 </span>                :   virtual Random_t Value();
<span class="lineNum">     576 </span>                :   virtual Random* Copy() const;
<span class="lineNum">     577 </span>                :   //Doc:Method
<span class="lineNum">     578 </span>                :   virtual void     CDF(Random_t, CDF_t);  // Value, prob &lt;= Value 
<span class="lineNum">     579 </span>                :     //Doc:Desc Specifies  a point in the empirical distribution.
<span class="lineNum">     580 </span>                :     //Doc:Arg1 The function value for this point.
<span class="lineNum">     581 </span>                :     //Doc:Arg2 Probability that the function is less than or equal
<span class="lineNum">     582 </span>                :     //Doc:Arg2 to the specified value. 
<span class="lineNum">     583 </span>                : private:
<span class="lineNum">     584 </span>                :   virtual void     Validate();  // Insure non-decreasing emiprical values
<span class="lineNum">     585 </span>                :   virtual Random_t Interpolate(CDF_t, CDF_t, Random_t, Random_t, CDF_t);
<span class="lineNum">     586 </span>                :   bool               validated; // True if non-decreasing validated 
<span class="lineNum">     587 </span>                :   ValueCDFVec_t      emp;       // Empicical CDF
<span class="lineNum">     588 </span>                : };
<span class="lineNum">     589 </span>                : 
<span class="lineNum">     590 </span>                : //Doc:ClassXRef
<span class="lineNum">     591 </span><span class="lineNoCov">              0 : class IntEmpirical : public Empirical { // Empirical distribution, integer</span>
<span class="lineNum">     592 </span>                :   //Doc:Class Defines an empirical distribution where all values are integers. 
<span class="lineNum">     593 </span>                :   //Doc:Class Indentical to {\tt Empirical}, but with slightly different
<span class="lineNum">     594 </span>                :   //Doc:Class interpolation between points.
<span class="lineNum">     595 </span>                :   // Identical to Empirical, but slightly different interpolation
<span class="lineNum">     596 </span>                : public:
<span class="lineNum">     597 </span>                :   //Doc:Method 
<span class="lineNum">     598 </span><span class="lineNoCov">              0 :   IntEmpirical() { }</span>
<span class="lineNum">     599 </span>                :     //Doc:Desc Constructor for {\tt IntEmpirical}
<span class="lineNum">     600 </span>                : 
<span class="lineNum">     601 </span>                :   virtual Random* Copy() const;
<span class="lineNum">     602 </span>                :   virtual IRandom_t IntValue();
<span class="lineNum">     603 </span>                :   virtual Random_t Interpolate(CDF_t, CDF_t, Random_t, Random_t, CDF_t); 
<span class="lineNum">     604 </span>                : };
<span class="lineNum">     605 </span>                : 
<span class="lineNum">     606 </span>                : //Doc:ClassXRef
<span class="lineNum">     607 </span><span class="lineNoCov">              0 : class Deterministic : public Random { // Deterministic distribution random var</span>
<span class="lineNum">     608 </span>                :   //Doc:Class Defines a random variable  that has a specified, deterministic
<span class="lineNum">     609 </span>                :   //Doc:Class distribution.  This would be useful when trying to force 
<span class="lineNum">     610 </span>                :   //Doc:Class the RNG to return a known sequence, perhaps to
<span class="lineNum">     611 </span>                :   //Doc:Class compare GTNetS to some other simulator
<span class="lineNum">     612 </span>                : public:
<span class="lineNum">     613 </span>                :   //Doc:Method
<span class="lineNum">     614 </span>                :   explicit Deterministic(Random_t*, Count_t);
<span class="lineNum">     615 </span>                :     //Doc:Desc Constructor for the {\tt Deterministic} random variables. 
<span class="lineNum">     616 </span>                :     //Doc:Arg1 Pointer to array of random values to return in sequence
<span class="lineNum">     617 </span>                :     //Doc:Arg2 Number of values in the array.
<span class="lineNum">     618 </span>                : 
<span class="lineNum">     619 </span><span class="lineNoCov">              0 :   virtual ~Deterministic() { }</span>
<span class="lineNum">     620 </span>                :   virtual Random_t Value();
<span class="lineNum">     621 </span>                :   virtual Random* Copy() const; 
<span class="lineNum">     622 </span>                : private:
<span class="lineNum">     623 </span>                :   Count_t   count;
<span class="lineNum">     624 </span>                :   Count_t   next;
<span class="lineNum">     625 </span>                :   Random_t* data;
<span class="lineNum">     626 </span>                : };
<span class="lineNum">     627 </span>                : 
<span class="lineNum">     628 </span>                : 
<span class="lineNum">     629 </span>                : #endif
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
  <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
  <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LTP GCOV extension version 1.6</a></td></tr>
  </table>
  <br>

</body>
</html>
